<template>
  <div>
    <!--  头部  -->
    <header>
      <nav-top></nav-top>
    </header>
    <section>
      <!--   主体界面   -->
      <div class="main">
        <!--    文章界面    -->
        <div class="content">
          <div class="invited-title">
            <h2>
              邀请回答 <span>{{ invitedAll }}</span>
            </h2>
            <div>
              <div :class="{ active: is_follow === 1 }" @click="saveIndex(1)">
                所有人<span>{{ invitedAll }}</span>
              </div>
              <div :class="{ active: is_follow === 2 }" @click="saveIndex(2)">
                我关注的人<span>0</span>
              </div>
            </div>
          </div>
          <div
            class="question-item-hot"
            v-for="(q_item, q_index) in questionItem"
            :key="q_index"
            v-show="is_follow === 1"
          >
            <div class="q-content">
              <h3>{{ q_item.question_title }}</h3>
              <div>
                <span><i class="el-icon-edit"></i>写回答</span>
                <span><i class="icon-ignore"></i>忽略</span>
                <span><i class="el-icon-time"></i>稍后答</span>
              </div>
            </div>
            <div class="q-num-info">
              <div>
                <span>{{ q_item.answer_num }}</span>
                <span>回答</span>
              </div>
              <div>
                <span>{{ q_item.look_num }}</span>
                <span>浏览</span>
              </div>
            </div>
          </div>
        </div>
        <div class="content-right">
          <!--     其他功能     -->
          <div class="user-mould">
            <router-link to="./answer">
              <div>
                <img
                  src="../assets/images/write-answer.png"
                  width="40"
                  height="40"
                  alt=""
                />
                <span>写回答</span>
              </div>
            </router-link>
            <router-link to="./writing">
              <div>
                <img
                  src="../assets/images/write-essay.png"
                  width="39"
                  height="40"
                  alt=""
                />
                <span>写文章</span>
              </div>
            </router-link>
            <router-link to="./invited">
              <div>
                <img
                  src="../assets/images/invitation-answer.png"
                  width="40"
                  height="34"
                  alt=""
                />
                <span>邀我答</span>
              </div>
            </router-link>
            <router-link to="./later">
              <div>
                <img
                  src="../assets/images/process-later.png"
                  width="38"
                  height="34"
                  alt=""
                />
                <span>稍后答</span>
              </div>
            </router-link>
            <router-link to="">
              <div>
                <img
                  src="../assets/images/draft-box.png"
                  width="40"
                  height="34"
                  alt=""
                />
                <span>草稿箱</span>
              </div>
            </router-link>
            <router-link to="">
              <div>
                <img
                  src="../assets/images/collect-question.png"
                  width="39"
                  height="34"
                  alt=""
                />
                <span>收藏夹</span>
              </div>
            </router-link>
            <router-link to="">
              <div>
                <img
                  src="../assets/images/tip-off.png"
                  width="45"
                  height="40"
                  alt=""
                />
                <span>举报中心</span>
              </div>
            </router-link>
            <router-link to="">
              <div>
                <img
                  src="../assets/images/list-rule.png"
                  width="38"
                  height="40"
                  alt=""
                />
                <span>榜单规则</span>
              </div>
            </router-link>
          </div>
          <p>
            Copyright©2019 Lawpro<br />
            沪ICP备19012546号
          </p>
        </div>
      </div>
    </section>
  </div>
</template>

<script>
export default {
  name: "forget",
  data() {
    return {
      is_follow: 1,
      num: 64,
      questionItem: [
        {
          question_title: "实习律师如何才能提升法律文书写作水平？",
          answer_num: 14,
          look_num: "22,552"
        },
        {
          question_title: "实习律师如何才能提升法律文书写作水平？",
          answer_num: 14,
          look_num: "22,552"
        },
        {
          question_title: "实习律师如何才能提升法律文书写作水平？",
          answer_num: 14,
          look_num: "22,552"
        },
        {
          question_title: "实习律师如何才能提升法律文书写作水平？",
          answer_num: 14,
          look_num: "22,552"
        }
      ]
    };
  },
  methods: {
    saveIndex(index) {
      this.is_follow = index;
    }
  },
  computed: {
    invitedAll: function() {
      return this.questionItem.length;
    }
  }
};
</script>

<style scoped lang="less">
/*头部*/
header {
  z-index: 9999;
  position: fixed;
  top: 0;
  width: 100%;
  padding: 10px 0;
  background-color: #fff;
  box-shadow: 0 2px 2px 0 rgba(237, 237, 237, 0.4);
}
/*主体*/
section {
  width: 100%;
  height: 100%;
  min-height: 100vh;
  padding-top: 15px;
  margin-top: 55px;
  background-color: #f6f6f6;

  .main {
    display: flex;
    justify-content: space-between;
    width: 1000px;
    margin: 0 auto;
    padding: 0 15px;
    box-sizing: border-box;

    .content {
      width: 69%;
      height: 100%;
      border-radius: 2px;
      box-sizing: border-box;
      .invited-title {
        background-color: #fff;
        h2 {
          padding: 30px 15px;
          color: #333;
          span {
            color: #95998f;
          }
        }
        & > div {
          display: flex;
          padding: 30px 15px 15px;
          border: 1px #f6f6f6;
          border-style: solid none solid none;
          & > div {
            position: relative;
            margin-right: 40px;
            font-size: 15px;
            color: #000;
            cursor: pointer;
            span {
              margin-left: 5px;
              color: #95998f;
            }
          }
          .active {
            font-weight: 600;
            &:after {
              position: absolute;
              bottom: -16px;
              left: 0;
              display: inline-block;
              width: 100%;
              border-bottom: 3px solid #6b9147;
              content: "";
            }
          }
        }
      }
      .question-item-hot {
        display: flex;
        justify-content: space-between;
        padding: 25px 15px;
        margin-bottom: 15px;
        background-color: #fff;
        .q-content {
          & > h3 {
            color: #262625;
            cursor: pointer;
            &:hover {
              color: #689d35;
            }
          }
          & > div {
            margin-top: 20px;
            .icon-ignore {
              display: inline-block;
              width: 15px;
              height: 15px;
              vertical-align: middle;
              background: url("../assets/images/ignore.png") no-repeat;
              background-size: 100% 100%;
            }
            i {
              margin-right: 5px;
              font-weight: bold;
            }
            span:first-child {
              color: #689d35;
            }
            span {
              margin-right: 30px;
              font-size: 15px;
              color: #95998f;
              cursor: pointer;
            }
          }
        }
        .q-num-info {
          display: flex;
          margin-top: 20px;
          & > div {
            display: flex;
            flex-direction: column;
            margin-left: 40px;
            font-size: 15px;
            color: #95998f;
            text-align: center;
          }
        }
      }
    }
    .content-right {
      width: 30%;
      .user-mould {
        display: flex;
        flex-wrap: wrap;
        padding: 10px;
        text-align: center;
        border-radius: 2px;
        background-color: #fff;
        box-shadow: 0 1px 1px 0 rgba(237, 237, 237, 0.4);
        a {
          width: 135px;
          color: #000;
          div {
            display: flex;
            flex-direction: column;
            margin: 10px 0;
            font-size: 14px;
            cursor: pointer;

            img {
              margin: 10px auto;
            }
          }
        }
      }
      & > p {
        margin-top: 10px;
        line-height: 30px;
        font-size: 15px;
        color: #7d8178;
      }
    }
  }
}
</style>
